<?php include './function.php';?>

<html>
    <head>
        <meta charset="UTF-8">
        <title>NhutVinh</title>
        <link href="stype.css" rel="stylesheet" type="text/css"/>
    </head>
   
    <body>
       <div class="wrapper" >
        <?php 
       $sql = 'select * from students;';
       $students = query($sql);
       //var_dump($students);
       ?>
        <table>
             <?php                   echo 'STUDENTS';?>
            <tr>
                <th>id</th>
                <th>name</th>
               
            </tr>      
            <?php foreach ($students as $student): ?>
            <tr>
                <td><?php echo ($student['id']); ?>
                </td>
                <td><?php echo ($student['name']); ?></td>
            </tr>
            <?php endforeach; ?>
        </table>
            <form id="form1" name="form1" method="post" action="insert.php">
            <input type="text" name="basic_name1" id="textfield" />
            <input type="text" name="basic_name2" id="textfield" />
            <input type="submit" name="button" id="button" value="Thêm" />
            </form>
            <form id="form2" name="form2" method="post" action="del.php">
            <input type="text" name="basic_name1" id="textfield" />
            <input type="submit" name="button" id="button" value="Xóa" />
            </form>
            <form id="form3" name="form3" method="post" action="update.php">
            <input type="text" name="basic_name1" id="textfield" />
            <input type="text" name="basic_name2" id="textfield" />
            <input type="submit" name="button" id="button" value="Update" />
            </form>
            <div>
                <h2>Tim Ten</h2>
                <form name="timkiem" action="search.php" method="post">
                    <input type="text" name="user" value="" size="25px" />
                    <input type="submit" name="ok" value="Search" />
                </form>
            </div>
        <?php 
      
        
        
        $sql = 'select * from staffs;';
       $staffs = query($sql);
      // var_dump($staffs);
       ?>
        <table >
            <?php                   echo 'STAFFS';?>
            <tr>
                <th>id</th>
                <th>name</th>
               
            </tr>      
            <?php foreach ($staffs as $staff): ?>
            <tr>
                <td><?php echo ($staff['id']); ?></td>
                <td><?php echo ($staff['name']); ?></td>
            </tr>
            <?php endforeach; ?>
            
        </table>
           <form id="form1" name="form1" method="post" action="insert_sta.php">
                <input type="text" name="basic_name1" id="textfield" />
                <input type="text" name="basic_name2" id="textfield" />
                <input type="submit" name="button" id="button" value="Thêm" />
           </form>
           </form>
                <form id="form2" name="form2" method="post" action="del2.php">
                <input type="text" name="basic_name1" id="textfield" />
                <input type="submit" name="button" id="button" value="Xóa" />
            </form>
           <form id="form3" name="form3" method="post" action="update2.php">
                <input type="text" name="basic_name1" id="textfield" />
                <input type="text" name="basic_name2" id="textfield" />
                <input type="submit" name="button" id="button" value="Update" />
            </form>
           <div>
                <h2>Tim Ten</h2>
                <form name="timkiem" action="search2.php" method="post">
                    <input type="text" name="user" value="" size="25px" />
                    <input type="submit" name="ok" value="Search" />
                </form>
            </div>
       </div>
    </body>
</html>